package com.osce.interfaces.score;

import com.baomidou.mybatisplus.extension.service.IService;
import com.csce.domain.entity.score.ScoreExExam;
import com.csce.domain.entity.score.excel.ExamExaminer;
import com.csce.domain.entity.score.excel.ExamSimulatedPatient;
import com.csce.domain.entity.score.excel.ExamStudent;
import com.csce.domain.entity.score.vo.ExamAllotResult;

import java.io.IOException;
import java.io.OutputStream;
import java.util.List;
import java.util.Map;

/**
 * 考试Service接口
 *
 * @author zzx
 * @since 2023-09-05
 */
public interface IScoreExExamService extends IService<ScoreExExam> {

    /**
     * 查询考试
     *
     * @param id 考试主键
     * @return 考试
     */
    ScoreExExam selectScoreExExamById(Long id);

    /**
     * 查询考试列表
     *
     * @param scoreExExam 考试
     * @return 考试集合
     */
    List<ScoreExExam> selectScoreExExamList(ScoreExExam scoreExExam);

    /**
     * 新增考试
     *
     * @param scoreExExam 考试
     * @return 结果
     */
    int insertScoreExExam(ScoreExExam scoreExExam);

    /**
     * 修改考试
     *
     * @param scoreExExam 考试
     * @return 结果
     */
    int updateScoreExExam(ScoreExExam scoreExExam);

    /**
     * 批量删除考试
     *
     * @param ids 需要删除的考试主键集合
     * @return 结果
     */
    int deleteScoreExExamByIds(Long[] ids);

    /**
     * 删除考试信息
     *
     * @param id 考试主键
     * @return 结果
     */
    int deleteScoreExExamById(Long id);

    /**
     * 排站
     */
    ScoreExExam allot(Long id);

    /**
     * 清除排站
     */
    ScoreExExam clearAllot(Long id);

    ExamAllotResult selectAllot(Long id);

    Map<String, Object> selectAllotAll(Long id);

    void planStudent(Long id);

    void clearPlanStudent(Long id);

    //==========excel=============
    List<ExamStudent> getExcelStudents(Long id);

    List<ExamExaminer> getExcelExaminers(Long id);

    List<ExamSimulatedPatient> getExcelSimulatedPatients(Long id);

    void exportExcelAllInfos(Long id, OutputStream out) throws IOException;

    //=======================
    List<ScoreExExam> selectScoreExExamTodayList();

    Map<String, Object> getExamTodayDateById(Long id);

    void checkIsInExamByUser(Long examId, Long userId);

    Map<String,Object> selectStatistics(Long examId);
}
